<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="style.css" /><script type="text/javascript" src="highlight.js"></script></head><body><pre><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-2"></span><span class="hs-comment">--</span><span>
</span><span id="line-3"></span><span class="hs-comment">-- Code generation for profiling</span><span>
</span><span id="line-4"></span><span class="hs-comment">--</span><span>
</span><span id="line-5"></span><span class="hs-comment">-- (c) The University of Glasgow 2004-2006</span><span>
</span><span id="line-6"></span><span class="hs-comment">--</span><span>
</span><span id="line-7"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-8"></span><span>
</span><span id="line-9"></span><span class="hs-keyword">module</span><span> </span><span class="hs-identifier">GHC.StgToCmm.Prof</span><span> </span><span class="hs-special">(</span><span>
</span><span id="line-10"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#initCostCentres"><span class="hs-identifier">initCostCentres</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#ccType"><span class="hs-identifier">ccType</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#ccsType"><span class="hs-identifier">ccsType</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-11"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#mkCCostCentre"><span class="hs-identifier">mkCCostCentre</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#mkCCostCentreStack"><span class="hs-identifier">mkCCostCentreStack</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-12"></span><span>
</span><span id="line-13"></span><span>        </span><span class="hs-comment">-- Cost-centre Profiling</span><span>
</span><span id="line-14"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#dynProfHdr"><span class="hs-identifier">dynProfHdr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#profDynAlloc"><span class="hs-identifier">profDynAlloc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#profAlloc"><span class="hs-identifier">profAlloc</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#staticProfHdr"><span class="hs-identifier">staticProfHdr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#initUpdFrameProf"><span class="hs-identifier">initUpdFrameProf</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-15"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#enterCostCentreThunk"><span class="hs-identifier">enterCostCentreThunk</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#enterCostCentreFun"><span class="hs-identifier">enterCostCentreFun</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-16"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#costCentreFrom"><span class="hs-identifier">costCentreFrom</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-17"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#storeCurCCS"><span class="hs-identifier">storeCurCCS</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-18"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#emitSetCCC"><span class="hs-identifier">emitSetCCC</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-19"></span><span>
</span><span id="line-20"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#saveCurrentCostCentre"><span class="hs-identifier">saveCurrentCostCentre</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#restoreCurrentCostCentre"><span class="hs-identifier">restoreCurrentCostCentre</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-21"></span><span>
</span><span id="line-22"></span><span>        </span><span class="hs-comment">-- Lag/drag/void stuff</span><span>
</span><span id="line-23"></span><span>        </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#ldvEnter"><span class="hs-identifier">ldvEnter</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#ldvEnterClosure"><span class="hs-identifier">ldvEnterClosure</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Prof.html#ldvRecordCreate"><span class="hs-identifier">ldvRecordCreate</span></a></span><span>
</span><span id="line-24"></span><span>  </span><span class="hs-special">)</span><span> </span><span class="hs-keyword">where</span><span>
</span><span id="line-25"></span><span>
</span><span id="line-26"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Prelude.html"><span class="hs-identifier">GHC.Prelude</span></a></span><span>
</span><span id="line-27"></span><span>
</span><span id="line-28"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#"><span class="hs-identifier">GHC.Platform</span></a></span><span>
</span><span id="line-29"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Closure.html"><span class="hs-identifier">GHC.StgToCmm.Closure</span></a></span><span>
</span><span id="line-30"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Utils.html"><span class="hs-identifier">GHC.StgToCmm.Utils</span></a></span><span>
</span><span id="line-31"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html"><span class="hs-identifier">GHC.StgToCmm.Monad</span></a></span><span>
</span><span id="line-32"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html"><span class="hs-identifier">GHC.Runtime.Heap.Layout</span></a></span><span>
</span><span id="line-33"></span><span>
</span><span id="line-34"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html"><span class="hs-identifier">GHC.Cmm.Graph</span></a></span><span>
</span><span id="line-35"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.html"><span class="hs-identifier">GHC.Cmm</span></a></span><span>
</span><span id="line-36"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.Utils.html"><span class="hs-identifier">GHC.Cmm.Utils</span></a></span><span>
</span><span id="line-37"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Cmm.CLabel.html"><span class="hs-identifier">GHC.Cmm.CLabel</span></a></span><span>
</span><span id="line-38"></span><span>
</span><span id="line-39"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html"><span class="hs-identifier">GHC.Types.CostCentre</span></a></span><span>
</span><span id="line-40"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html"><span class="hs-identifier">GHC.Driver.Session</span></a></span><span>
</span><span id="line-41"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Data.FastString.html"><span class="hs-identifier">GHC.Data.FastString</span></a></span><span>
</span><span id="line-42"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Unit.Module.html"><span class="hs-identifier">GHC.Unit.Module</span></a></span><span> </span><span class="hs-keyword">as</span><span> </span><span class="annot"><span class="hs-identifier">Module</span></span><span>
</span><span id="line-43"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="GHC.Utils.Outputable.html"><span class="hs-identifier">GHC.Utils.Outputable</span></a></span><span>
</span><span id="line-44"></span><span>
</span><span id="line-45"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Control.Monad.html#"><span class="hs-identifier">Control.Monad</span></a></span><span>
</span><span id="line-46"></span><span class="hs-keyword">import</span><span> </span><span class="annot"><a href="../../base/src/Data.Char.html#"><span class="hs-identifier">Data.Char</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Base.html#ord"><span class="hs-identifier">ord</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-47"></span><span>
</span><span id="line-48"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-49"></span><span class="hs-comment">--</span><span>
</span><span id="line-50"></span><span class="hs-comment">-- Cost-centre-stack Profiling</span><span>
</span><span id="line-51"></span><span class="hs-comment">--</span><span>
</span><span id="line-52"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-53"></span><span>
</span><span id="line-54"></span><span class="hs-comment">-- Expression representing the current cost centre stack</span><span>
</span><span id="line-55"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#ccsType"><span class="hs-identifier hs-type">ccsType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Type.html#CmmType"><span class="hs-identifier hs-type">CmmType</span></a></span><span> </span><span class="hs-comment">-- Type of a cost-centre stack</span><span>
</span><span id="line-56"></span><span id="ccsType"><span class="annot"><span class="annottext">ccsType :: Platform -&gt; CmmType
</span><a href="GHC.StgToCmm.Prof.html#ccsType"><span class="hs-identifier hs-var hs-var">ccsType</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmType
</span><a href="GHC.Cmm.Type.html#bWord"><span class="hs-identifier hs-var">bWord</span></a></span><span>
</span><span id="line-57"></span><span>
</span><span id="line-58"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#ccType"><span class="hs-identifier hs-type">ccType</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Type.html#CmmType"><span class="hs-identifier hs-type">CmmType</span></a></span><span> </span><span class="hs-comment">-- Type of a cost centre</span><span>
</span><span id="line-59"></span><span id="ccType"><span class="annot"><span class="annottext">ccType :: Platform -&gt; CmmType
</span><a href="GHC.StgToCmm.Prof.html#ccType"><span class="hs-identifier hs-var hs-var">ccType</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmType
</span><a href="GHC.Cmm.Type.html#bWord"><span class="hs-identifier hs-var">bWord</span></a></span><span>
</span><span id="line-60"></span><span>
</span><span id="line-61"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#storeCurCCS"><span class="hs-identifier hs-type">storeCurCCS</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-62"></span><span id="storeCurCCS"><span class="annot"><span class="annottext">storeCurCCS :: CmmExpr -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Prof.html#storeCurCCS"><span class="hs-identifier hs-var hs-var">storeCurCCS</span></a></span></span><span> </span><span id="local-6989586621681052157"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052157"><span class="hs-identifier hs-var">e</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkAssign"><span class="hs-identifier hs-var">mkAssign</span></a></span><span> </span><span class="annot"><span class="annottext">CmmReg
</span><a href="GHC.Cmm.Expr.html#cccsReg"><span class="hs-identifier hs-var">cccsReg</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052157"><span class="hs-identifier hs-var">e</span></a></span><span>
</span><span id="line-63"></span><span>
</span><span id="line-64"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#mkCCostCentre"><span class="hs-identifier hs-type">mkCCostCentre</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#CostCentre"><span class="hs-identifier hs-type">CostCentre</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span>
</span><span id="line-65"></span><span id="mkCCostCentre"><span class="annot"><span class="annottext">mkCCostCentre :: CostCentre -&gt; CmmLit
</span><a href="GHC.StgToCmm.Prof.html#mkCCostCentre"><span class="hs-identifier hs-var hs-var">mkCCostCentre</span></a></span></span><span> </span><span id="local-6989586621681052154"><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681052154"><span class="hs-identifier hs-var">cc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CostCentre -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkCCLabel"><span class="hs-identifier hs-var">mkCCLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681052154"><span class="hs-identifier hs-var">cc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-66"></span><span>
</span><span id="line-67"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#mkCCostCentreStack"><span class="hs-identifier hs-type">mkCCostCentreStack</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#CostCentreStack"><span class="hs-identifier hs-type">CostCentreStack</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span>
</span><span id="line-68"></span><span id="mkCCostCentreStack"><span class="annot"><span class="annottext">mkCCostCentreStack :: CostCentreStack -&gt; CmmLit
</span><a href="GHC.StgToCmm.Prof.html#mkCCostCentreStack"><span class="hs-identifier hs-var hs-var">mkCCostCentreStack</span></a></span></span><span> </span><span id="local-6989586621681052151"><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681052151"><span class="hs-identifier hs-var">ccs</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmLabel"><span class="hs-identifier hs-var">CmmLabel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CostCentreStack -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkCCSLabel"><span class="hs-identifier hs-var">mkCCSLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681052151"><span class="hs-identifier hs-var">ccs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-69"></span><span>
</span><span id="line-70"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#costCentreFrom"><span class="hs-identifier hs-type">costCentreFrom</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span>
</span><span id="line-71"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>         </span><span class="hs-comment">-- A closure pointer</span><span>
</span><span id="line-72"></span><span>               </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>        </span><span class="hs-comment">-- The cost centre from that closure</span><span>
</span><span id="line-73"></span><span id="costCentreFrom"><span class="annot"><span class="annottext">costCentreFrom :: DynFlags -&gt; CmmExpr -&gt; CmmExpr
</span><a href="GHC.StgToCmm.Prof.html#costCentreFrom"><span class="hs-identifier hs-var hs-var">costCentreFrom</span></a></span></span><span> </span><span id="local-6989586621681052149"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052149"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681052148"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052148"><span class="hs-identifier hs-var">cl</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmType -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLoad"><span class="hs-identifier hs-var">CmmLoad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; Int -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#cmmOffsetB"><span class="hs-identifier hs-var">cmmOffsetB</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052145"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052148"><span class="hs-identifier hs-var">cl</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#oFFSET_StgHeader_ccs"><span class="hs-identifier hs-var">oFFSET_StgHeader_ccs</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052149"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmType
</span><a href="GHC.StgToCmm.Prof.html#ccsType"><span class="hs-identifier hs-var">ccsType</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052145"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-74"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681052145"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681052145"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052149"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-75"></span><span>
</span><span id="line-76"></span><span class="hs-comment">-- | The profiling header words in a static closure</span><span>
</span><span id="line-77"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#staticProfHdr"><span class="hs-identifier hs-type">staticProfHdr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#CostCentreStack"><span class="hs-identifier hs-type">CostCentreStack</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-78"></span><span id="staticProfHdr"><span class="annot"><span class="annottext">staticProfHdr :: DynFlags -&gt; CostCentreStack -&gt; [CmmLit]
</span><a href="GHC.StgToCmm.Prof.html#staticProfHdr"><span class="hs-identifier hs-var hs-var">staticProfHdr</span></a></span></span><span> </span><span id="local-6989586621681052142"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052142"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681052141"><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681052141"><span class="hs-identifier hs-var">ccs</span></a></span></span><span>
</span><span id="line-79"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#sccProfilingEnabled"><span class="hs-identifier hs-var">sccProfilingEnabled</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052142"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CostCentreStack -&gt; CmmLit
</span><a href="GHC.StgToCmm.Prof.html#mkCCostCentreStack"><span class="hs-identifier hs-var">mkCCostCentreStack</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681052141"><span class="hs-identifier hs-var">ccs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmLit
</span><a href="GHC.StgToCmm.Prof.html#staticLdvInit"><span class="hs-identifier hs-var">staticLdvInit</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052138"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-80"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-81"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681052138"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681052138"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052142"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-82"></span><span>
</span><span id="line-83"></span><span class="hs-comment">-- | Profiling header words in a dynamic closure</span><span>
</span><span id="line-84"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#dynProfHdr"><span class="hs-identifier hs-type">dynProfHdr</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="hs-special">[</span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-85"></span><span id="dynProfHdr"><span class="annot"><span class="annottext">dynProfHdr :: DynFlags -&gt; CmmExpr -&gt; [CmmExpr]
</span><a href="GHC.StgToCmm.Prof.html#dynProfHdr"><span class="hs-identifier hs-var hs-var">dynProfHdr</span></a></span></span><span> </span><span id="local-6989586621681052137"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052137"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681052136"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052136"><span class="hs-identifier hs-var">ccs</span></a></span></span><span>
</span><span id="line-86"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#sccProfilingEnabled"><span class="hs-identifier hs-var">sccProfilingEnabled</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052137"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052136"><span class="hs-identifier hs-var">ccs</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; CmmExpr
</span><a href="GHC.StgToCmm.Prof.html#dynLdvInit"><span class="hs-identifier hs-var">dynLdvInit</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052137"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">]</span><span>
</span><span id="line-87"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>                  </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span class="hs-special">]</span><span>
</span><span id="line-88"></span><span>
</span><span id="line-89"></span><span class="hs-comment">-- | Initialise the profiling field of an update frame</span><span>
</span><span id="line-90"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#initUpdFrameProf"><span class="hs-identifier hs-type">initUpdFrameProf</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-91"></span><span id="initUpdFrameProf"><span class="annot"><span class="annottext">initUpdFrameProf :: CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#initUpdFrameProf"><span class="hs-identifier hs-var hs-var">initUpdFrameProf</span></a></span></span><span> </span><span id="local-6989586621681052134"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052134"><span class="hs-identifier hs-var">frame</span></a></span></span><span>
</span><span id="line-92"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FCode () -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#ifProfiling"><span class="hs-identifier hs-var">ifProfiling</span></a></span><span> </span><span class="annot"><span class="annottext">(FCode () -&gt; FCode ()) -&gt; FCode () -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>        </span><span class="hs-comment">-- frame-&gt;header.prof.ccs = CCCS</span><span>
</span><span id="line-93"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681052132"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052132"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-94"></span><span>       </span><span id="local-6989586621681052130"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052130"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-95"></span><span>       </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitStore"><span class="hs-identifier hs-var">emitStore</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; Int -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#cmmOffset"><span class="hs-identifier hs-var">cmmOffset</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052130"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052134"><span class="hs-identifier hs-var">frame</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#oFFSET_StgHeader_ccs"><span class="hs-identifier hs-var">oFFSET_StgHeader_ccs</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052132"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="GHC.Cmm.Utils.html#cccsExpr"><span class="hs-identifier hs-var">cccsExpr</span></a></span><span>
</span><span id="line-96"></span><span>        </span><span class="hs-comment">-- frame-&gt;header.prof.hp.rs = NULL (or frame-header.prof.hp.ldvw = 0)</span><span>
</span><span id="line-97"></span><span>        </span><span class="hs-comment">-- is unnecessary because it is not used anyhow.</span><span>
</span><span id="line-98"></span><span>
</span><span id="line-99"></span><span class="hs-comment">---------------------------------------------------------------------------</span><span>
</span><span id="line-100"></span><span class="hs-comment">--         Saving and restoring the current cost centre</span><span>
</span><span id="line-101"></span><span class="hs-comment">---------------------------------------------------------------------------</span><span>
</span><span id="line-102"></span><span>
</span><span id="line-103"></span><span class="hs-comment">{-        Note [Saving the current cost centre]
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The current cost centre is like a global register.  Like other
global registers, it's a caller-saves one.  But consider
        case (f x) of (p,q) -&gt; rhs
Since 'f' may set the cost centre, we must restore it
before resuming rhs.  So we want code like this:
        local_cc = CCC  -- save
        r = f( x )
        CCC = local_cc  -- restore
That is, we explicitly &quot;save&quot; the current cost centre in
a LocalReg, local_cc; and restore it after the call. The
C-- infrastructure will arrange to save local_cc across the
call.

The same goes for join points;
        let j x = join-stuff
        in blah-blah
We want this kind of code:
        local_cc = CCC  -- save
        blah-blah
     J:
        CCC = local_cc  -- restore
-}</span><span>
</span><span id="line-127"></span><span>
</span><span id="line-128"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#saveCurrentCostCentre"><span class="hs-identifier hs-type">saveCurrentCostCentre</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-129"></span><span>        </span><span class="hs-comment">-- Returns Nothing if profiling is off</span><span>
</span><span id="line-130"></span><span id="saveCurrentCostCentre"><span class="annot"><span class="annottext">saveCurrentCostCentre :: FCode (Maybe LocalReg)
</span><a href="GHC.StgToCmm.Prof.html#saveCurrentCostCentre"><span class="hs-identifier hs-var hs-var">saveCurrentCostCentre</span></a></span></span><span>
</span><span id="line-131"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681052125"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052125"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-132"></span><span>       </span><span id="local-6989586621681052124"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052124"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-133"></span><span>       </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#sccProfilingEnabled"><span class="hs-identifier hs-var">sccProfilingEnabled</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052125"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-134"></span><span>           </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">Maybe LocalReg -&gt; FCode (Maybe LocalReg)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="annot"><span class="annottext">Maybe LocalReg
forall a. Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-135"></span><span>           </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681052122"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681052122"><span class="hs-identifier hs-var">local_cc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmType -&gt; FCode LocalReg
forall (m :: * -&gt; *). MonadUnique m =&gt; CmmType -&gt; m LocalReg
</span><a href="GHC.StgToCmm.Utils.html#newTemp"><span class="hs-identifier hs-var">newTemp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmType
</span><a href="GHC.StgToCmm.Prof.html#ccType"><span class="hs-identifier hs-var">ccType</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052124"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-136"></span><span>                   </span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emitAssign"><span class="hs-identifier hs-var">emitAssign</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681052122"><span class="hs-identifier hs-var">local_cc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="GHC.Cmm.Utils.html#cccsExpr"><span class="hs-identifier hs-var">cccsExpr</span></a></span><span>
</span><span id="line-137"></span><span>                   </span><span class="annot"><span class="annottext">Maybe LocalReg -&gt; FCode (Maybe LocalReg)
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; Maybe LocalReg
forall a. a -&gt; Maybe a
</span><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-var">Just</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681052122"><span class="hs-identifier hs-var">local_cc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-138"></span><span>
</span><span id="line-139"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#restoreCurrentCostCentre"><span class="hs-identifier hs-type">restoreCurrentCostCentre</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Maybe"><span class="hs-identifier hs-type">Maybe</span></a></span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-140"></span><span id="restoreCurrentCostCentre"><span class="annot"><span class="annottext">restoreCurrentCostCentre :: Maybe LocalReg -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#restoreCurrentCostCentre"><span class="hs-identifier hs-var hs-var">restoreCurrentCostCentre</span></a></span></span><span> </span><span class="annot"><span class="annottext">Maybe LocalReg
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span>
</span><span id="line-141"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">() -&gt; FCode ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-142"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#restoreCurrentCostCentre"><span class="hs-identifier hs-var">restoreCurrentCostCentre</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681052118"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681052118"><span class="hs-identifier hs-var">local_cc</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-143"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Prof.html#storeCurCCS"><span class="hs-identifier hs-var">storeCurCCS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-var">CmmReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681052118"><span class="hs-identifier hs-var">local_cc</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-144"></span><span>
</span><span id="line-145"></span><span>
</span><span id="line-146"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-147"></span><span class="hs-comment">-- Recording allocation in a cost centre</span><span>
</span><span id="line-148"></span><span class="hs-comment">-------------------------------------------------------------------------------</span><span>
</span><span id="line-149"></span><span>
</span><span id="line-150"></span><span class="hs-comment">-- | Record the allocation of a closure.  The CmmExpr is the cost</span><span>
</span><span id="line-151"></span><span class="hs-comment">-- centre stack to which to attribute the allocation.</span><span>
</span><span id="line-152"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#profDynAlloc"><span class="hs-identifier hs-type">profDynAlloc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Runtime.Heap.Layout.html#SMRep"><span class="hs-identifier hs-type">SMRep</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-153"></span><span id="profDynAlloc"><span class="annot"><span class="annottext">profDynAlloc :: SMRep -&gt; CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#profDynAlloc"><span class="hs-identifier hs-var hs-var">profDynAlloc</span></a></span></span><span> </span><span id="local-6989586621681052115"><span class="annot"><span class="annottext">SMRep
</span><a href="#local-6989586621681052115"><span class="hs-identifier hs-var">rep</span></a></span></span><span> </span><span id="local-6989586621681052114"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052114"><span class="hs-identifier hs-var">ccs</span></a></span></span><span>
</span><span id="line-154"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FCode () -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#ifProfiling"><span class="hs-identifier hs-var">ifProfiling</span></a></span><span> </span><span class="annot"><span class="annottext">(FCode () -&gt; FCode ()) -&gt; FCode () -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-155"></span><span>    </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681052113"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052113"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-156"></span><span>       </span><span id="local-6989586621681052112"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052112"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-157"></span><span>       </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#profAlloc"><span class="hs-identifier hs-var">profAlloc</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Int -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#mkIntExpr"><span class="hs-identifier hs-var">mkIntExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052112"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; SMRep -&gt; Int
</span><a href="GHC.Runtime.Heap.Layout.html#heapClosureSizeW"><span class="hs-identifier hs-var">heapClosureSizeW</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052113"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">SMRep
</span><a href="#local-6989586621681052115"><span class="hs-identifier hs-var">rep</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052114"><span class="hs-identifier hs-var">ccs</span></a></span><span>
</span><span id="line-158"></span><span>
</span><span id="line-159"></span><span class="hs-comment">-- | Record the allocation of a closure (size is given by a CmmExpr)</span><span>
</span><span id="line-160"></span><span class="hs-comment">-- The size must be in words, because the allocation counter in a CCS counts</span><span>
</span><span id="line-161"></span><span class="hs-comment">-- in words.</span><span>
</span><span id="line-162"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#profAlloc"><span class="hs-identifier hs-type">profAlloc</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-163"></span><span id="profAlloc"><span class="annot"><span class="annottext">profAlloc :: CmmExpr -&gt; CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#profAlloc"><span class="hs-identifier hs-var hs-var">profAlloc</span></a></span></span><span> </span><span id="local-6989586621681052109"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052109"><span class="hs-identifier hs-var">words</span></a></span></span><span> </span><span id="local-6989586621681052108"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052108"><span class="hs-identifier hs-var">ccs</span></a></span></span><span>
</span><span id="line-164"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">FCode () -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#ifProfiling"><span class="hs-identifier hs-var">ifProfiling</span></a></span><span> </span><span class="annot"><span class="annottext">(FCode () -&gt; FCode ()) -&gt; FCode () -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-165"></span><span>        </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681052107"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052107"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-166"></span><span>           </span><span id="local-6989586621681052106"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052106"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-167"></span><span>           </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681052105"><span class="annot"><span class="annottext">alloc_rep :: CmmType
</span><a href="#local-6989586621681052105"><span class="hs-identifier hs-var hs-var">alloc_rep</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; CmmType
</span><a href="GHC.Cmm.Type.html#rEP_CostCentreStack_mem_alloc"><span class="hs-identifier hs-var">rEP_CostCentreStack_mem_alloc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052107"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-168"></span><span>           </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmType -&gt; CmmExpr -&gt; CmmExpr -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#addToMemE"><span class="hs-identifier hs-var">addToMemE</span></a></span><span> </span><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681052105"><span class="hs-identifier hs-var">alloc_rep</span></a></span><span>
</span><span id="line-169"></span><span>                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; Int -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#cmmOffsetB"><span class="hs-identifier hs-var">cmmOffsetB</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052106"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052108"><span class="hs-identifier hs-var">ccs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#oFFSET_CostCentreStack_mem_alloc"><span class="hs-identifier hs-var">oFFSET_CostCentreStack_mem_alloc</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052107"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-170"></span><span>                       </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MachOp -&gt; [CmmExpr] -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmMachOp"><span class="hs-identifier hs-var">CmmMachOp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Width -&gt; Width -&gt; MachOp
</span><a href="GHC.Cmm.MachOp.html#MO_UU_Conv"><span class="hs-identifier hs-var">MO_UU_Conv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Width
</span><a href="GHC.Cmm.Type.html#wordWidth"><span class="hs-identifier hs-var">wordWidth</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052106"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmType -&gt; Width
</span><a href="GHC.Cmm.Type.html#typeWidth"><span class="hs-identifier hs-var">typeWidth</span></a></span><span> </span><span class="annot"><span class="annottext">CmmType
</span><a href="#local-6989586621681052105"><span class="hs-identifier hs-var">alloc_rep</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">([CmmExpr] -&gt; CmmExpr) -&gt; [CmmExpr] -&gt; CmmExpr
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-171"></span><span>                         </span><span class="hs-special">[</span><span class="annot"><span class="annottext">MachOp -&gt; [CmmExpr] -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmMachOp"><span class="hs-identifier hs-var">CmmMachOp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; MachOp
</span><a href="GHC.Cmm.MachOp.html#mo_wordSub"><span class="hs-identifier hs-var">mo_wordSub</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052106"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052109"><span class="hs-identifier hs-var">words</span></a></span><span class="hs-special">,</span><span>
</span><span id="line-172"></span><span>                                                           </span><span class="annot"><span class="annottext">Platform -&gt; Int -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#mkIntExpr"><span class="hs-identifier hs-var">mkIntExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052106"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Runtime.Heap.Layout.html#profHdrSize"><span class="hs-identifier hs-var">profHdrSize</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052107"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">]</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-173"></span><span>                       </span><span class="hs-comment">-- subtract the &quot;profiling overhead&quot;, which is the</span><span>
</span><span id="line-174"></span><span>                       </span><span class="hs-comment">-- profiling header in a closure.</span><span>
</span><span id="line-175"></span><span>
</span><span id="line-176"></span><span class="hs-comment">-- -----------------------------------------------------------------------</span><span>
</span><span id="line-177"></span><span class="hs-comment">-- Setting the current cost centre on entry to a closure</span><span>
</span><span id="line-178"></span><span>
</span><span id="line-179"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#enterCostCentreThunk"><span class="hs-identifier hs-type">enterCostCentreThunk</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-180"></span><span id="enterCostCentreThunk"><span class="annot"><span class="annottext">enterCostCentreThunk :: CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#enterCostCentreThunk"><span class="hs-identifier hs-var hs-var">enterCostCentreThunk</span></a></span></span><span> </span><span id="local-6989586621681052095"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052095"><span class="hs-identifier hs-var">closure</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-181"></span><span>  </span><span class="annot"><span class="annottext">FCode () -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#ifProfiling"><span class="hs-identifier hs-var">ifProfiling</span></a></span><span> </span><span class="annot"><span class="annottext">(FCode () -&gt; FCode ()) -&gt; FCode () -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-182"></span><span>      </span><span id="local-6989586621681052094"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052094"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-183"></span><span>      </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmAGraph -&gt; FCode ()) -&gt; CmmAGraph -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Prof.html#storeCurCCS"><span class="hs-identifier hs-var">storeCurCCS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; CmmExpr -&gt; CmmExpr
</span><a href="GHC.StgToCmm.Prof.html#costCentreFrom"><span class="hs-identifier hs-var">costCentreFrom</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052094"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052095"><span class="hs-identifier hs-var">closure</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-184"></span><span>
</span><span id="line-185"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#enterCostCentreFun"><span class="hs-identifier hs-type">enterCostCentreFun</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#CostCentreStack"><span class="hs-identifier hs-type">CostCentreStack</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-186"></span><span id="enterCostCentreFun"><span class="annot"><span class="annottext">enterCostCentreFun :: CostCentreStack -&gt; CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#enterCostCentreFun"><span class="hs-identifier hs-var hs-var">enterCostCentreFun</span></a></span></span><span> </span><span id="local-6989586621681052093"><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681052093"><span class="hs-identifier hs-var">ccs</span></a></span></span><span> </span><span id="local-6989586621681052092"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052092"><span class="hs-identifier hs-var">closure</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>
</span><span id="line-187"></span><span>  </span><span class="annot"><span class="annottext">FCode () -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#ifProfiling"><span class="hs-identifier hs-var">ifProfiling</span></a></span><span> </span><span class="annot"><span class="annottext">(FCode () -&gt; FCode ()) -&gt; FCode () -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-188"></span><span>    </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">CostCentreStack -&gt; Bool
</span><a href="GHC.Types.CostCentre.html#isCurrentCCS"><span class="hs-identifier hs-var">isCurrentCCS</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681052093"><span class="hs-identifier hs-var">ccs</span></a></span><span>
</span><span id="line-189"></span><span>       </span><span class="hs-keyword">then</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681052090"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052090"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-190"></span><span>               </span><span class="annot"><span class="annottext">UnitId
-&gt; FastString -&gt; [(CmmExpr, ForeignHint)] -&gt; Bool -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitRtsCall"><span class="hs-identifier hs-var">emitRtsCall</span></a></span><span> </span><span class="annot"><span class="annottext">UnitId
</span><a href="GHC.Unit.Types.html#rtsUnitId"><span class="hs-identifier hs-var">rtsUnitId</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;enterFunCCS&quot;</span></span><span class="hs-special">)</span><span>
</span><span id="line-191"></span><span>                   </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr
</span><a href="GHC.Cmm.Utils.html#baseExpr"><span class="hs-identifier hs-var">baseExpr</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ForeignHint
</span><a href="GHC.Cmm.Type.html#AddrHint"><span class="hs-identifier hs-var">AddrHint</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-192"></span><span>                    </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; CmmExpr -&gt; CmmExpr
</span><a href="GHC.StgToCmm.Prof.html#costCentreFrom"><span class="hs-identifier hs-var">costCentreFrom</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052090"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052092"><span class="hs-identifier hs-var">closure</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ForeignHint
</span><a href="GHC.Cmm.Type.html#AddrHint"><span class="hs-identifier hs-var">AddrHint</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span> </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-193"></span><span>       </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">() -&gt; FCode ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- top-level function, nothing to do</span><span>
</span><span id="line-194"></span><span>
</span><span id="line-195"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#ifProfiling"><span class="hs-identifier hs-type">ifProfiling</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-196"></span><span id="ifProfiling"><span class="annot"><span class="annottext">ifProfiling :: FCode () -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#ifProfiling"><span class="hs-identifier hs-var hs-var">ifProfiling</span></a></span></span><span> </span><span id="local-6989586621681052084"><span class="annot"><span class="annottext">FCode ()
</span><a href="#local-6989586621681052084"><span class="hs-identifier hs-var">code</span></a></span></span><span>
</span><span id="line-197"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681052083"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052083"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-198"></span><span>       </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#sccProfilingEnabled"><span class="hs-identifier hs-var">sccProfilingEnabled</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052083"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-199"></span><span>           </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">FCode ()
</span><a href="#local-6989586621681052084"><span class="hs-identifier hs-var">code</span></a></span><span>
</span><span id="line-200"></span><span>           </span><span class="hs-keyword">else</span><span> </span><span class="annot"><span class="annottext">() -&gt; FCode ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-201"></span><span>
</span><span id="line-202"></span><span class="hs-comment">---------------------------------------------------------------</span><span>
</span><span id="line-203"></span><span class="hs-comment">--        Initialising Cost Centres &amp; CCSs</span><span>
</span><span id="line-204"></span><span class="hs-comment">---------------------------------------------------------------</span><span>
</span><span id="line-205"></span><span>
</span><span id="line-206"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#initCostCentres"><span class="hs-identifier hs-type">initCostCentres</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#CollectedCCs"><span class="hs-identifier hs-type">CollectedCCs</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-207"></span><span class="hs-comment">-- Emit the declarations</span><span>
</span><span id="line-208"></span><span id="initCostCentres"><span class="annot"><span class="annottext">initCostCentres :: CollectedCCs -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#initCostCentres"><span class="hs-identifier hs-var hs-var">initCostCentres</span></a></span></span><span> </span><span class="hs-special">(</span><span id="local-6989586621681052082"><span class="annot"><span class="annottext">[CostCentre]
</span><a href="#local-6989586621681052082"><span class="hs-identifier hs-var">local_CCs</span></a></span></span><span class="hs-special">,</span><span> </span><span id="local-6989586621681052081"><span class="annot"><span class="annottext">[CostCentreStack]
</span><a href="#local-6989586621681052081"><span class="hs-identifier hs-var">singleton_CCSs</span></a></span></span><span class="hs-special">)</span><span>
</span><span id="line-209"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681052080"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052080"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-210"></span><span>       </span><span class="annot"><span class="annottext">Bool -&gt; FCode () -&gt; FCode ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#sccProfilingEnabled"><span class="hs-identifier hs-var">sccProfilingEnabled</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052080"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">(FCode () -&gt; FCode ()) -&gt; FCode () -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-211"></span><span>           </span><span class="hs-keyword">do</span><span> </span><span class="annot"><span class="annottext">(CostCentre -&gt; FCode ()) -&gt; [CostCentre] -&gt; FCode ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentre -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#emitCostCentreDecl"><span class="hs-identifier hs-var">emitCostCentreDecl</span></a></span><span> </span><span class="annot"><span class="annottext">[CostCentre]
</span><a href="#local-6989586621681052082"><span class="hs-identifier hs-var">local_CCs</span></a></span><span>
</span><span id="line-212"></span><span>              </span><span class="annot"><span class="annottext">(CostCentreStack -&gt; FCode ()) -&gt; [CostCentreStack] -&gt; FCode ()
forall (t :: * -&gt; *) (m :: * -&gt; *) a b.
(Foldable t, Monad m) =&gt;
(a -&gt; m b) -&gt; t a -&gt; m ()
</span><a href="../../base/src/Data.Foldable.html#mapM_"><span class="hs-identifier hs-var">mapM_</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#emitCostCentreStackDecl"><span class="hs-identifier hs-var">emitCostCentreStackDecl</span></a></span><span> </span><span class="annot"><span class="annottext">[CostCentreStack]
</span><a href="#local-6989586621681052081"><span class="hs-identifier hs-var">singleton_CCSs</span></a></span><span>
</span><span id="line-213"></span><span>
</span><span id="line-214"></span><span>
</span><span id="line-215"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#emitCostCentreDecl"><span class="hs-identifier hs-type">emitCostCentreDecl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#CostCentre"><span class="hs-identifier hs-type">CostCentre</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-216"></span><span id="emitCostCentreDecl"><span class="annot"><span class="annottext">emitCostCentreDecl :: CostCentre -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#emitCostCentreDecl"><span class="hs-identifier hs-var hs-var">emitCostCentreDecl</span></a></span></span><span> </span><span id="local-6989586621681052075"><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681052075"><span class="hs-identifier hs-var">cc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-217"></span><span>  </span><span class="hs-special">{</span><span> </span><span id="local-6989586621681052074"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052074"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-218"></span><span>  </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681052073"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052073"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-219"></span><span>  </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681052072"><span class="annot"><span class="annottext">is_caf :: CmmLit
</span><a href="#local-6989586621681052072"><span class="hs-identifier hs-var hs-var">is_caf</span></a></span></span><span> </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">CostCentre -&gt; Bool
</span><a href="GHC.Types.CostCentre.html#isCafCC"><span class="hs-identifier hs-var">isCafCC</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681052075"><span class="hs-identifier hs-var">cc</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Int -&gt; CmmLit
</span><a href="GHC.Cmm.Utils.html#mkIntCLit"><span class="hs-identifier hs-var">mkIntCLit</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052073"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Char -&gt; Int
</span><a href="../../base/src/GHC.Base.html#ord"><span class="hs-identifier hs-var">ord</span></a></span><span> </span><span class="annot"><span class="annottext">Char
</span><span class="hs-char">'c'</span></span><span class="hs-special">)</span><span> </span><span class="hs-comment">-- 'c' == is a CAF</span><span>
</span><span id="line-220"></span><span>               </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmLit
</span><a href="GHC.StgToCmm.Prof.html#zero"><span class="hs-identifier hs-var">zero</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052073"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-221"></span><span>                        </span><span class="hs-comment">-- NB. bytesFS: we want the UTF-8 bytes here (#5559)</span><span>
</span><span id="line-222"></span><span>  </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681052068"><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681052068"><span class="hs-keyword hs-var">label</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; FCode CmmLit
</span><a href="GHC.StgToCmm.Utils.html#newByteStringCLit"><span class="hs-identifier hs-var">newByteStringCLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; ByteString
</span><a href="GHC.Data.FastString.html#bytesFS"><span class="hs-identifier hs-var">bytesFS</span></a></span><span> </span><span class="annot"><span class="annottext">(FastString -&gt; ByteString) -&gt; FastString -&gt; ByteString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentre -&gt; FastString
</span><a href="GHC.Types.CostCentre.html#costCentreUserNameFS"><span class="hs-identifier hs-var">costCentreUserNameFS</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681052075"><span class="hs-identifier hs-var">cc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-223"></span><span>  </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681052064"><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681052064"><span class="hs-identifier hs-var">modl</span></a></span></span><span>  </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; FCode CmmLit
</span><a href="GHC.StgToCmm.Utils.html#newByteStringCLit"><span class="hs-identifier hs-var">newByteStringCLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; ByteString
</span><a href="GHC.Data.FastString.html#bytesFS"><span class="hs-identifier hs-var">bytesFS</span></a></span><span> </span><span class="annot"><span class="annottext">(FastString -&gt; ByteString) -&gt; FastString -&gt; ByteString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">ModuleName -&gt; FastString
</span><a href="GHC.Unit.Module.Name.html#moduleNameFS"><span class="hs-identifier hs-var">moduleNameFS</span></a></span><span>
</span><span id="line-224"></span><span>                                        </span><span class="annot"><span class="annottext">(ModuleName -&gt; FastString) -&gt; ModuleName -&gt; FastString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">GenModule Unit -&gt; ModuleName
forall unit. GenModule unit -&gt; ModuleName
</span><a href="GHC.Unit.Types.html#moduleName"><span class="hs-identifier hs-var hs-var">moduleName</span></a></span><span>
</span><span id="line-225"></span><span>                                        </span><span class="annot"><span class="annottext">(GenModule Unit -&gt; ModuleName) -&gt; GenModule Unit -&gt; ModuleName
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentre -&gt; GenModule Unit
</span><a href="GHC.Types.CostCentre.html#cc_mod"><span class="hs-identifier hs-var hs-var">cc_mod</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681052075"><span class="hs-identifier hs-var">cc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-226"></span><span>  </span><span class="hs-special">;</span><span> </span><span id="local-6989586621681052060"><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681052060"><span class="hs-identifier hs-var">loc</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">ByteString -&gt; FCode CmmLit
</span><a href="GHC.StgToCmm.Utils.html#newByteStringCLit"><span class="hs-identifier hs-var">newByteStringCLit</span></a></span><span> </span><span class="annot"><span class="annottext">(ByteString -&gt; FCode CmmLit) -&gt; ByteString -&gt; FCode CmmLit
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">FastString -&gt; ByteString
</span><a href="GHC.Data.FastString.html#bytesFS"><span class="hs-identifier hs-var">bytesFS</span></a></span><span> </span><span class="annot"><span class="annottext">(FastString -&gt; ByteString) -&gt; FastString -&gt; ByteString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#mkFastString"><span class="hs-identifier hs-var">mkFastString</span></a></span><span> </span><span class="annot"><span class="annottext">(String -&gt; FastString) -&gt; String -&gt; FastString
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-227"></span><span>                   </span><span class="annot"><span class="annottext">DynFlags -&gt; SrcSpan -&gt; String
forall a. Outputable a =&gt; DynFlags -&gt; a -&gt; String
</span><a href="GHC.Utils.Outputable.html#showPpr"><span class="hs-identifier hs-var">showPpr</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052074"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CostCentre -&gt; SrcSpan
</span><a href="GHC.Types.CostCentre.html#costCentreSrcSpan"><span class="hs-identifier hs-var">costCentreSrcSpan</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681052075"><span class="hs-identifier hs-var">cc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-228"></span><span>           </span><span class="hs-comment">-- XXX going via FastString to get UTF-8 encoding is silly</span><span>
</span><span id="line-229"></span><span>  </span><span class="hs-special">;</span><span> </span><span class="hs-keyword">let</span><span>
</span><span id="line-230"></span><span>     </span><span id="local-6989586621681052056"><span class="annot"><span class="annottext">lits :: [CmmLit]
</span><a href="#local-6989586621681052056"><span class="hs-identifier hs-var hs-var">lits</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-special">[</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmLit
</span><a href="GHC.StgToCmm.Prof.html#zero"><span class="hs-identifier hs-var">zero</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052073"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">,</span><span>  </span><span class="hs-comment">-- StgInt ccID,</span><span>
</span><span id="line-231"></span><span>              </span><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681052068"><span class="hs-keyword hs-var">label</span></a></span><span class="hs-special">,</span><span>          </span><span class="hs-comment">-- char *label,</span><span>
</span><span id="line-232"></span><span>              </span><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681052064"><span class="hs-identifier hs-var">modl</span></a></span><span class="hs-special">,</span><span>           </span><span class="hs-comment">-- char *module,</span><span>
</span><span id="line-233"></span><span>              </span><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681052060"><span class="hs-identifier hs-var">loc</span></a></span><span class="hs-special">,</span><span>            </span><span class="hs-comment">-- char *srcloc,</span><span>
</span><span id="line-234"></span><span>              </span><span class="annot"><span class="annottext">CmmLit
</span><a href="GHC.StgToCmm.Prof.html#zero64"><span class="hs-identifier hs-var">zero64</span></a></span><span class="hs-special">,</span><span>         </span><span class="hs-comment">-- StgWord64 mem_alloc</span><span>
</span><span id="line-235"></span><span>              </span><span class="annot"><span class="annottext">Platform -&gt; CmmLit
</span><a href="GHC.StgToCmm.Prof.html#zero"><span class="hs-identifier hs-var">zero</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052073"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">,</span><span>  </span><span class="hs-comment">-- StgWord time_ticks</span><span>
</span><span id="line-236"></span><span>              </span><span class="annot"><span class="annottext">CmmLit
</span><a href="#local-6989586621681052072"><span class="hs-identifier hs-var">is_caf</span></a></span><span class="hs-special">,</span><span>         </span><span class="hs-comment">-- StgInt is_caf</span><span>
</span><span id="line-237"></span><span>              </span><span class="annot"><span class="annottext">Platform -&gt; CmmLit
</span><a href="GHC.StgToCmm.Prof.html#zero"><span class="hs-identifier hs-var">zero</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052073"><span class="hs-identifier hs-var">platform</span></a></span><span>   </span><span class="hs-comment">-- struct _CostCentre *link</span><span>
</span><span id="line-238"></span><span>            </span><span class="hs-special">]</span><span>
</span><span id="line-239"></span><span>  </span><span class="hs-special">;</span><span> </span><span class="annot"><span class="annottext">CLabel -&gt; [CmmLit] -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitDataLits"><span class="hs-identifier hs-var">emitDataLits</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CostCentre -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkCCLabel"><span class="hs-identifier hs-var">mkCCLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681052075"><span class="hs-identifier hs-var">cc</span></a></span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">[CmmLit]
</span><a href="#local-6989586621681052056"><span class="hs-identifier hs-var">lits</span></a></span><span>
</span><span id="line-240"></span><span>  </span><span class="hs-special">}</span><span>
</span><span id="line-241"></span><span>
</span><span id="line-242"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#emitCostCentreStackDecl"><span class="hs-identifier hs-type">emitCostCentreStackDecl</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#CostCentreStack"><span class="hs-identifier hs-type">CostCentreStack</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-243"></span><span id="emitCostCentreStackDecl"><span class="annot"><span class="annottext">emitCostCentreStackDecl :: CostCentreStack -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#emitCostCentreStackDecl"><span class="hs-identifier hs-var hs-var">emitCostCentreStackDecl</span></a></span></span><span> </span><span id="local-6989586621681052053"><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681052053"><span class="hs-identifier hs-var">ccs</span></a></span></span><span>
</span><span id="line-244"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">case</span><span> </span><span class="annot"><span class="annottext">CostCentreStack -&gt; Maybe CostCentre
</span><a href="GHC.Types.CostCentre.html#maybeSingletonCCS"><span class="hs-identifier hs-var">maybeSingletonCCS</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681052053"><span class="hs-identifier hs-var">ccs</span></a></span><span> </span><span class="hs-keyword">of</span><span>
</span><span id="line-245"></span><span>    </span><span class="annot"><a href="../../base/src/GHC.Maybe.html#Just"><span class="hs-identifier hs-type">Just</span></a></span><span> </span><span id="local-6989586621681052051"><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681052051"><span class="hs-identifier hs-var">cc</span></a></span></span><span> </span><span class="hs-glyph">-&gt;</span><span>
</span><span id="line-246"></span><span>        </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681052050"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052050"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-247"></span><span>           </span><span id="local-6989586621681052049"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052049"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-248"></span><span>           </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681052046"><span class="annot"><span class="annottext">mk_lits :: CostCentre -&gt; [CmmLit]
</span><a href="#local-6989586621681052046"><span class="hs-identifier hs-var hs-var">mk_lits</span></a></span></span><span> </span><span id="local-6989586621681052045"><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681052045"><span class="hs-identifier hs-var">cc</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmLit
</span><a href="GHC.StgToCmm.Prof.html#zero"><span class="hs-identifier hs-var">zero</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052049"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; [CmmLit] -&gt; [CmmLit]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span>
</span><span id="line-249"></span><span>                            </span><span class="annot"><span class="annottext">CostCentre -&gt; CmmLit
</span><a href="GHC.StgToCmm.Prof.html#mkCCostCentre"><span class="hs-identifier hs-var">mkCCostCentre</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681052045"><span class="hs-identifier hs-var">cc</span></a></span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; [CmmLit] -&gt; [CmmLit]
forall a. a -&gt; [a] -&gt; [a]
</span><span class="hs-glyph hs-var">:</span></span><span>
</span><span id="line-250"></span><span>                            </span><span class="annot"><span class="annottext">Int -&gt; CmmLit -&gt; [CmmLit]
forall a. Int -&gt; a -&gt; [a]
</span><a href="../../base/src/GHC.List.html#replicate"><span class="hs-identifier hs-var">replicate</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.StgToCmm.Prof.html#sizeof_ccs_words"><span class="hs-identifier hs-var">sizeof_ccs_words</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052050"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#-"><span class="hs-glyph hs-var">-</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">2</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmLit
</span><a href="GHC.StgToCmm.Prof.html#zero"><span class="hs-identifier hs-var">zero</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052049"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-251"></span><span>                </span><span class="hs-comment">-- Note: to avoid making any assumptions about how the</span><span>
</span><span id="line-252"></span><span>                </span><span class="hs-comment">-- C compiler (that compiles the RTS, in particular) does</span><span>
</span><span id="line-253"></span><span>                </span><span class="hs-comment">-- layouts of structs containing long-longs, simply</span><span>
</span><span id="line-254"></span><span>                </span><span class="hs-comment">-- pad out the struct with zero words until we hit the</span><span>
</span><span id="line-255"></span><span>                </span><span class="hs-comment">-- size of the overall struct (which we get via DerivedConstants.h)</span><span>
</span><span id="line-256"></span><span>           </span><span class="annot"><span class="annottext">CLabel -&gt; [CmmLit] -&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitDataLits"><span class="hs-identifier hs-var">emitDataLits</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CostCentreStack -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkCCSLabel"><span class="hs-identifier hs-var">mkCCSLabel</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681052053"><span class="hs-identifier hs-var">ccs</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CostCentre -&gt; [CmmLit]
</span><a href="#local-6989586621681052046"><span class="hs-identifier hs-var">mk_lits</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681052051"><span class="hs-identifier hs-var">cc</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-257"></span><span>    </span><span class="annot"><span class="annottext">Maybe CostCentre
</span><a href="../../base/src/GHC.Maybe.html#Nothing"><span class="hs-identifier hs-var">Nothing</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="annottext">String -&gt; SDoc -&gt; FCode ()
forall a. HasCallStack =&gt; String -&gt; SDoc -&gt; a
</span><a href="GHC.Utils.Outputable.html#pprPanic"><span class="hs-identifier hs-var">pprPanic</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;emitCostCentreStackDecl&quot;</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CostCentreStack -&gt; SDoc
forall a. Outputable a =&gt; a -&gt; SDoc
</span><a href="GHC.Utils.Outputable.html#ppr"><span class="hs-identifier hs-var">ppr</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentreStack
</span><a href="#local-6989586621681052053"><span class="hs-identifier hs-var">ccs</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-258"></span><span>
</span><span id="line-259"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#zero"><span class="hs-identifier hs-type">zero</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span>
</span><span id="line-260"></span><span id="zero"><span class="annot"><span class="annottext">zero :: Platform -&gt; CmmLit
</span><a href="GHC.StgToCmm.Prof.html#zero"><span class="hs-identifier hs-var hs-var">zero</span></a></span></span><span> </span><span id="local-6989586621681052040"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052040"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Int -&gt; CmmLit
</span><a href="GHC.Cmm.Utils.html#mkIntCLit"><span class="hs-identifier hs-var">mkIntCLit</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052040"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>
</span><span id="line-261"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#zero64"><span class="hs-identifier hs-type">zero64</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span>
</span><span id="line-262"></span><span id="zero64"><span class="annot"><span class="annottext">zero64 :: CmmLit
</span><a href="GHC.StgToCmm.Prof.html#zero64"><span class="hs-identifier hs-var hs-var">zero64</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Integer -&gt; Width -&gt; CmmLit
</span><a href="GHC.Cmm.Expr.html#CmmInt"><span class="hs-identifier hs-var">CmmInt</span></a></span><span> </span><span class="annot"><span class="annottext">Integer
</span><span class="hs-number">0</span></span><span> </span><span class="annot"><span class="annottext">Width
</span><a href="GHC.Cmm.Type.html#W64"><span class="hs-identifier hs-var">W64</span></a></span><span>
</span><span id="line-263"></span><span>
</span><span id="line-264"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#sizeof_ccs_words"><span class="hs-identifier hs-type">sizeof_ccs_words</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Int</span></span><span>
</span><span id="line-265"></span><span id="sizeof_ccs_words"><span class="annot"><span class="annottext">sizeof_ccs_words :: DynFlags -&gt; Int
</span><a href="GHC.StgToCmm.Prof.html#sizeof_ccs_words"><span class="hs-identifier hs-var hs-var">sizeof_ccs_words</span></a></span></span><span> </span><span id="local-6989586621681052037"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052037"><span class="hs-identifier hs-var">dflags</span></a></span></span><span>
</span><span id="line-266"></span><span>    </span><span class="hs-comment">-- round up to the next word.</span><span>
</span><span id="line-267"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681052036"><span class="hs-identifier hs-var">ms</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Bool
forall a. Eq a =&gt; a -&gt; a -&gt; Bool
</span><span class="hs-operator hs-var">==</span></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">0</span></span><span>   </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681052035"><span class="hs-identifier hs-var">ws</span></a></span><span>
</span><span id="line-268"></span><span>  </span><span class="hs-glyph">|</span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="../../base/src/GHC.Base.html#otherwise"><span class="hs-identifier hs-var">otherwise</span></a></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681052035"><span class="hs-identifier hs-var">ws</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; Int
forall a. Num a =&gt; a -&gt; a -&gt; a
</span><a href="../../base/src/GHC.Num.html#%2B"><span class="hs-operator hs-var">+</span></a></span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-269"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-270"></span><span>   </span><span id="local-6989586621681052033"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681052033"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052037"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-271"></span><span>   </span><span class="hs-special">(</span><span id="local-6989586621681052035"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681052035"><span class="hs-identifier hs-var">ws</span></a></span></span><span class="hs-special">,</span><span id="local-6989586621681052036"><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681052036"><span class="hs-identifier hs-var">ms</span></a></span></span><span class="hs-special">)</span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#sIZEOF_CostCentreStack"><span class="hs-identifier hs-var">sIZEOF_CostCentreStack</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052037"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">Int -&gt; Int -&gt; (Int, Int)
forall a. Integral a =&gt; a -&gt; a -&gt; (a, a)
</span><a href="../../base/src/GHC.Real.html#divMod"><span class="hs-operator hs-var">`divMod`</span></a></span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Int
</span><a href="../../ghc-boot/src/GHC.Platform.html#platformWordSizeInBytes"><span class="hs-identifier hs-var">platformWordSizeInBytes</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052033"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-272"></span><span>
</span><span id="line-273"></span><span class="hs-comment">-- ---------------------------------------------------------------------------</span><span>
</span><span id="line-274"></span><span class="hs-comment">-- Set the current cost centre stack</span><span>
</span><span id="line-275"></span><span>
</span><span id="line-276"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#emitSetCCC"><span class="hs-identifier hs-type">emitSetCCC</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#CostCentre"><span class="hs-identifier hs-type">CostCentre</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><span class="hs-identifier hs-type">Bool</span></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-277"></span><span id="emitSetCCC"><span class="annot"><span class="annottext">emitSetCCC :: CostCentre -&gt; Bool -&gt; Bool -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#emitSetCCC"><span class="hs-identifier hs-var hs-var">emitSetCCC</span></a></span></span><span> </span><span id="local-6989586621681052027"><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681052027"><span class="hs-identifier hs-var">cc</span></a></span></span><span> </span><span id="local-6989586621681052026"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681052026"><span class="hs-identifier hs-var">tick</span></a></span></span><span> </span><span id="local-6989586621681052025"><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681052025"><span class="hs-identifier hs-var">push</span></a></span></span><span>
</span><span id="line-278"></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681052024"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052024"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-279"></span><span>      </span><span id="local-6989586621681052023"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052023"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-280"></span><span>      </span><span class="hs-keyword">if</span><span> </span><span class="annot"><span class="annottext">Bool -&gt; Bool
</span><span class="hs-identifier hs-var">not</span></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Bool
</span><a href="GHC.Driver.Session.html#sccProfilingEnabled"><span class="hs-identifier hs-var">sccProfilingEnabled</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052024"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-281"></span><span>          </span><span class="hs-keyword">then</span><span> </span><span class="annot"><span class="annottext">() -&gt; FCode ()
forall (m :: * -&gt; *) a. Monad m =&gt; a -&gt; m a
</span><a href="../../base/src/GHC.Base.html#return"><span class="hs-identifier hs-var">return</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-282"></span><span>          </span><span class="hs-keyword">else</span><span> </span><span class="hs-keyword">do</span><span> </span><span id="local-6989586621681052022"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681052022"><span class="hs-identifier hs-var">tmp</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">CmmType -&gt; FCode LocalReg
forall (m :: * -&gt; *). MonadUnique m =&gt; CmmType -&gt; m LocalReg
</span><a href="GHC.StgToCmm.Utils.html#newTemp"><span class="hs-identifier hs-var">newTemp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmType
</span><a href="GHC.StgToCmm.Prof.html#ccsType"><span class="hs-identifier hs-var">ccsType</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052023"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-283"></span><span>                  </span><span class="annot"><span class="annottext">LocalReg -&gt; CmmExpr -&gt; CostCentre -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#pushCostCentre"><span class="hs-identifier hs-var">pushCostCentre</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681052022"><span class="hs-identifier hs-var">tmp</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="GHC.Cmm.Utils.html#cccsExpr"><span class="hs-identifier hs-var">cccsExpr</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681052027"><span class="hs-identifier hs-var">cc</span></a></span><span>
</span><span id="line-284"></span><span>                  </span><span class="annot"><span class="annottext">Bool -&gt; FCode () -&gt; FCode ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681052026"><span class="hs-identifier hs-var">tick</span></a></span><span> </span><span class="annot"><span class="annottext">(FCode () -&gt; FCode ()) -&gt; FCode () -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; CmmExpr -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Prof.html#bumpSccCount"><span class="hs-identifier hs-var">bumpSccCount</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052024"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-var">CmmReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681052022"><span class="hs-identifier hs-var">tmp</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-285"></span><span>                  </span><span class="annot"><span class="annottext">Bool -&gt; FCode () -&gt; FCode ()
forall (f :: * -&gt; *). Applicative f =&gt; Bool -&gt; f () -&gt; f ()
</span><a href="../../base/src/GHC.Base.html#when"><span class="hs-identifier hs-var">when</span></a></span><span> </span><span class="annot"><span class="annottext">Bool
</span><a href="#local-6989586621681052025"><span class="hs-identifier hs-var">push</span></a></span><span> </span><span class="annot"><span class="annottext">(FCode () -&gt; FCode ()) -&gt; FCode () -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Prof.html#storeCurCCS"><span class="hs-identifier hs-var">storeCurCCS</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-var">CmmReg</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">LocalReg -&gt; CmmReg
</span><a href="GHC.Cmm.Expr.html#CmmLocal"><span class="hs-identifier hs-var">CmmLocal</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681052022"><span class="hs-identifier hs-var">tmp</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-286"></span><span>
</span><span id="line-287"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#pushCostCentre"><span class="hs-identifier hs-type">pushCostCentre</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#LocalReg"><span class="hs-identifier hs-type">LocalReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Types.CostCentre.html#CostCentre"><span class="hs-identifier hs-type">CostCentre</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-288"></span><span id="pushCostCentre"><span class="annot"><span class="annottext">pushCostCentre :: LocalReg -&gt; CmmExpr -&gt; CostCentre -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#pushCostCentre"><span class="hs-identifier hs-var hs-var">pushCostCentre</span></a></span></span><span> </span><span id="local-6989586621681052019"><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681052019"><span class="hs-identifier hs-var">result</span></a></span></span><span> </span><span id="local-6989586621681052018"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052018"><span class="hs-identifier hs-var">ccs</span></a></span></span><span> </span><span id="local-6989586621681052017"><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681052017"><span class="hs-identifier hs-var">cc</span></a></span></span><span>
</span><span id="line-289"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">LocalReg
-&gt; ForeignHint
-&gt; UnitId
-&gt; FastString
-&gt; [(CmmExpr, ForeignHint)]
-&gt; Bool
-&gt; FCode ()
</span><a href="GHC.StgToCmm.Utils.html#emitRtsCallWithResult"><span class="hs-identifier hs-var">emitRtsCallWithResult</span></a></span><span> </span><span class="annot"><span class="annottext">LocalReg
</span><a href="#local-6989586621681052019"><span class="hs-identifier hs-var">result</span></a></span><span> </span><span class="annot"><span class="annottext">ForeignHint
</span><a href="GHC.Cmm.Type.html#AddrHint"><span class="hs-identifier hs-var">AddrHint</span></a></span><span>
</span><span id="line-290"></span><span>        </span><span class="annot"><span class="annottext">UnitId
</span><a href="GHC.Unit.Types.html#rtsUnitId"><span class="hs-identifier hs-var">rtsUnitId</span></a></span><span>
</span><span id="line-291"></span><span>        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;pushCostCentre&quot;</span></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052018"><span class="hs-identifier hs-var">ccs</span></a></span><span class="hs-special">,</span><span class="annot"><span class="annottext">ForeignHint
</span><a href="GHC.Cmm.Type.html#AddrHint"><span class="hs-identifier hs-var">AddrHint</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span>
</span><span id="line-292"></span><span>                                </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CostCentre -&gt; CmmLit
</span><a href="GHC.StgToCmm.Prof.html#mkCCostCentre"><span class="hs-identifier hs-var">mkCCostCentre</span></a></span><span> </span><span class="annot"><span class="annottext">CostCentre
</span><a href="#local-6989586621681052017"><span class="hs-identifier hs-var">cc</span></a></span><span class="hs-special">)</span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">ForeignHint
</span><a href="GHC.Cmm.Type.html#AddrHint"><span class="hs-identifier hs-var">AddrHint</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-293"></span><span>        </span><span class="annot"><span class="annottext">Bool
</span><span class="hs-identifier hs-var">False</span></span><span>
</span><span id="line-294"></span><span>
</span><span id="line-295"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#bumpSccCount"><span class="hs-identifier hs-type">bumpSccCount</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Graph.html#CmmAGraph"><span class="hs-identifier hs-type">CmmAGraph</span></a></span><span>
</span><span id="line-296"></span><span id="bumpSccCount"><span class="annot"><span class="annottext">bumpSccCount :: DynFlags -&gt; CmmExpr -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Prof.html#bumpSccCount"><span class="hs-identifier hs-var hs-var">bumpSccCount</span></a></span></span><span> </span><span id="local-6989586621681052014"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052014"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681052013"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052013"><span class="hs-identifier hs-var">ccs</span></a></span></span><span>
</span><span id="line-297"></span><span>  </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">CmmType -&gt; CmmExpr -&gt; Int -&gt; CmmAGraph
</span><a href="GHC.StgToCmm.Utils.html#addToMem"><span class="hs-identifier hs-var">addToMem</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; CmmType
</span><a href="GHC.Cmm.Type.html#rEP_CostCentreStack_scc_count"><span class="hs-identifier hs-var">rEP_CostCentreStack_scc_count</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052014"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-298"></span><span>         </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; Int -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#cmmOffsetB"><span class="hs-identifier hs-var">cmmOffsetB</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052010"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681052013"><span class="hs-identifier hs-var">ccs</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#oFFSET_CostCentreStack_scc_count"><span class="hs-identifier hs-var">oFFSET_CostCentreStack_scc_count</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052014"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span> </span><span class="annot"><span class="annottext">Int
</span><span class="hs-number">1</span></span><span>
</span><span id="line-299"></span><span>  </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681052010"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681052010"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052014"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-300"></span><span>
</span><span id="line-301"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-302"></span><span class="hs-comment">--</span><span>
</span><span id="line-303"></span><span class="hs-comment">--                Lag/drag/void stuff</span><span>
</span><span id="line-304"></span><span class="hs-comment">--</span><span>
</span><span id="line-305"></span><span class="hs-comment">-----------------------------------------------------------------------------</span><span>
</span><span id="line-306"></span><span>
</span><span id="line-307"></span><span class="hs-comment">--</span><span>
</span><span id="line-308"></span><span class="hs-comment">-- Initial value for the LDV field in a static closure</span><span>
</span><span id="line-309"></span><span class="hs-comment">--</span><span>
</span><span id="line-310"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#staticLdvInit"><span class="hs-identifier hs-type">staticLdvInit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="../../ghc-boot/src/GHC.Platform.html#Platform"><span class="hs-identifier hs-type">Platform</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-type">CmmLit</span></a></span><span>
</span><span id="line-311"></span><span id="staticLdvInit"><span class="annot"><span class="annottext">staticLdvInit :: Platform -&gt; CmmLit
</span><a href="GHC.StgToCmm.Prof.html#staticLdvInit"><span class="hs-identifier hs-var hs-var">staticLdvInit</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmLit
</span><a href="GHC.Cmm.Utils.html#zeroCLit"><span class="hs-identifier hs-var">zeroCLit</span></a></span><span>
</span><span id="line-312"></span><span>
</span><span id="line-313"></span><span class="hs-comment">--</span><span>
</span><span id="line-314"></span><span class="hs-comment">-- Initial value of the LDV field in a dynamic closure</span><span>
</span><span id="line-315"></span><span class="hs-comment">--</span><span>
</span><span id="line-316"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#dynLdvInit"><span class="hs-identifier hs-type">dynLdvInit</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>
</span><span id="line-317"></span><span id="dynLdvInit"><span class="annot"><span class="annottext">dynLdvInit :: DynFlags -&gt; CmmExpr
</span><a href="GHC.StgToCmm.Prof.html#dynLdvInit"><span class="hs-identifier hs-var hs-var">dynLdvInit</span></a></span></span><span> </span><span id="local-6989586621681052007"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052007"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span>     </span><span class="hs-comment">-- (era &lt;&lt; LDV_SHIFT) | LDV_STATE_CREATE</span><span>
</span><span id="line-318"></span><span>  </span><span class="annot"><span class="annottext">MachOp -&gt; [CmmExpr] -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmMachOp"><span class="hs-identifier hs-var">CmmMachOp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; MachOp
</span><a href="GHC.Cmm.MachOp.html#mo_wordOr"><span class="hs-identifier hs-var">mo_wordOr</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052005"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span>
</span><span id="line-319"></span><span>      </span><span class="annot"><span class="annottext">MachOp -&gt; [CmmExpr] -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmMachOp"><span class="hs-identifier hs-var">CmmMachOp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; MachOp
</span><a href="GHC.Cmm.MachOp.html#mo_wordShl"><span class="hs-identifier hs-var">mo_wordShl</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052005"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">DynFlags -&gt; CmmExpr
</span><a href="GHC.StgToCmm.Prof.html#loadEra"><span class="hs-identifier hs-var">loadEra</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052007"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; Int -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#mkIntExpr"><span class="hs-identifier hs-var">mkIntExpr</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052005"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#lDV_SHIFT"><span class="hs-identifier hs-var">lDV_SHIFT</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052007"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">,</span><span>
</span><span id="line-320"></span><span>      </span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; CmmLit
</span><a href="GHC.Cmm.Utils.html#mkWordCLit"><span class="hs-identifier hs-var">mkWordCLit</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681052005"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Integer
</span><a href="GHC.Driver.Session.html#iLDV_STATE_CREATE"><span class="hs-identifier hs-var">iLDV_STATE_CREATE</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052007"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-321"></span><span>  </span><span class="hs-special">]</span><span>
</span><span id="line-322"></span><span>  </span><span class="hs-keyword">where</span><span>
</span><span id="line-323"></span><span>   </span><span id="local-6989586621681052005"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681052005"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681052007"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-324"></span><span>
</span><span id="line-325"></span><span class="hs-comment">--</span><span>
</span><span id="line-326"></span><span class="hs-comment">-- Initialise the LDV word of a new closure</span><span>
</span><span id="line-327"></span><span class="hs-comment">--</span><span>
</span><span id="line-328"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#ldvRecordCreate"><span class="hs-identifier hs-type">ldvRecordCreate</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-329"></span><span id="ldvRecordCreate"><span class="annot"><span class="annottext">ldvRecordCreate :: CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#ldvRecordCreate"><span class="hs-identifier hs-var hs-var">ldvRecordCreate</span></a></span></span><span> </span><span id="local-6989586621681051999"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051999"><span class="hs-identifier hs-var">closure</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-330"></span><span>  </span><span id="local-6989586621681051998"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051998"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-331"></span><span>  </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmAGraph -&gt; FCode ()) -&gt; CmmAGraph -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmExpr -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkStore"><span class="hs-identifier hs-var">mkStore</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; CmmExpr -&gt; CmmExpr
</span><a href="GHC.StgToCmm.Prof.html#ldvWord"><span class="hs-identifier hs-var">ldvWord</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051998"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051999"><span class="hs-identifier hs-var">closure</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; CmmExpr
</span><a href="GHC.StgToCmm.Prof.html#dynLdvInit"><span class="hs-identifier hs-var">dynLdvInit</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051998"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-332"></span><span>
</span><span id="line-333"></span><span class="hs-comment">--</span><span>
</span><span id="line-334"></span><span class="hs-comment">-- | Called when a closure is entered, marks the closure as having</span><span>
</span><span id="line-335"></span><span class="hs-comment">-- been &quot;used&quot;.  The closure is not an &quot;inherently used&quot; one.  The</span><span>
</span><span id="line-336"></span><span class="hs-comment">-- closure is not @IND@ because that is not considered for LDV profiling.</span><span>
</span><span id="line-337"></span><span class="hs-comment">--</span><span>
</span><span id="line-338"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#ldvEnterClosure"><span class="hs-identifier hs-type">ldvEnterClosure</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Closure.html#ClosureInfo"><span class="hs-identifier hs-type">ClosureInfo</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-type">CmmReg</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-339"></span><span id="ldvEnterClosure"><span class="annot"><span class="annottext">ldvEnterClosure :: ClosureInfo -&gt; CmmReg -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#ldvEnterClosure"><span class="hs-identifier hs-var hs-var">ldvEnterClosure</span></a></span></span><span> </span><span id="local-6989586621681051995"><span class="annot"><span class="annottext">ClosureInfo
</span><a href="#local-6989586621681051995"><span class="hs-identifier hs-var">closure_info</span></a></span></span><span> </span><span id="local-6989586621681051994"><span class="annot"><span class="annottext">CmmReg
</span><a href="#local-6989586621681051994"><span class="hs-identifier hs-var">node_reg</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-340"></span><span>    </span><span id="local-6989586621681051993"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051993"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-341"></span><span>    </span><span id="local-6989586621681051992"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051992"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-342"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span id="local-6989586621681051991"><span class="annot"><span class="annottext">tag :: Int
</span><a href="#local-6989586621681051991"><span class="hs-identifier hs-var hs-var">tag</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; ClosureInfo -&gt; Int
</span><a href="GHC.StgToCmm.Closure.html#funTag"><span class="hs-identifier hs-var">funTag</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051993"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">ClosureInfo
</span><a href="#local-6989586621681051995"><span class="hs-identifier hs-var">closure_info</span></a></span><span>
</span><span id="line-343"></span><span>    </span><span class="hs-comment">-- don't forget to subtract node's tag</span><span>
</span><span id="line-344"></span><span>    </span><span class="annot"><span class="annottext">CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#ldvEnter"><span class="hs-identifier hs-var">ldvEnter</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; Int -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#cmmOffsetB"><span class="hs-identifier hs-var">cmmOffsetB</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051992"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmReg -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmReg"><span class="hs-identifier hs-var">CmmReg</span></a></span><span> </span><span class="annot"><span class="annottext">CmmReg
</span><a href="#local-6989586621681051994"><span class="hs-identifier hs-var">node_reg</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="hs-glyph">-</span><span class="annot"><span class="annottext">Int
</span><a href="#local-6989586621681051991"><span class="hs-identifier hs-var">tag</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-345"></span><span>
</span><span id="line-346"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#ldvEnter"><span class="hs-identifier hs-type">ldvEnter</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.StgToCmm.Monad.html#FCode"><span class="hs-identifier hs-type">FCode</span></a></span><span> </span><span class="hs-special">(</span><span class="hs-special">)</span><span>
</span><span id="line-347"></span><span class="hs-comment">-- Argument is a closure pointer</span><span>
</span><span id="line-348"></span><span id="ldvEnter"><span class="annot"><span class="annottext">ldvEnter :: CmmExpr -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#ldvEnter"><span class="hs-identifier hs-var hs-var">ldvEnter</span></a></span></span><span> </span><span id="local-6989586621681051989"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051989"><span class="hs-identifier hs-var">cl_ptr</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="hs-keyword">do</span><span>
</span><span id="line-349"></span><span>    </span><span id="local-6989586621681051988"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051988"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode DynFlags
forall (m :: * -&gt; *). HasDynFlags m =&gt; m DynFlags
</span><a href="GHC.Driver.Session.html#getDynFlags"><span class="hs-identifier hs-var">getDynFlags</span></a></span><span>
</span><span id="line-350"></span><span>    </span><span id="local-6989586621681051987"><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051987"><span class="hs-identifier hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">&lt;-</span><span> </span><span class="annot"><span class="annottext">FCode Platform
</span><a href="GHC.StgToCmm.Monad.html#getPlatform"><span class="hs-identifier hs-var">getPlatform</span></a></span><span>
</span><span id="line-351"></span><span>    </span><span class="hs-keyword">let</span><span> </span><span class="hs-comment">-- don't forget to subtract node's tag</span><span>
</span><span id="line-352"></span><span>        </span><span id="local-6989586621681051986"><span class="annot"><span class="annottext">ldv_wd :: CmmExpr
</span><a href="#local-6989586621681051986"><span class="hs-identifier hs-var hs-var">ldv_wd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; CmmExpr -&gt; CmmExpr
</span><a href="GHC.StgToCmm.Prof.html#ldvWord"><span class="hs-identifier hs-var">ldvWord</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051988"><span class="hs-identifier hs-var">dflags</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051989"><span class="hs-identifier hs-var">cl_ptr</span></a></span><span>
</span><span id="line-353"></span><span>        </span><span id="local-6989586621681051985"><span class="annot"><span class="annottext">new_ldv_wd :: CmmExpr
</span><a href="#local-6989586621681051985"><span class="hs-identifier hs-var hs-var">new_ldv_wd</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; CmmExpr -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#cmmOrWord"><span class="hs-identifier hs-var">cmmOrWord</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051987"><span class="hs-identifier hs-var">platform</span></a></span><span>
</span><span id="line-354"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; CmmExpr -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#cmmAndWord"><span class="hs-identifier hs-var">cmmAndWord</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051987"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmType -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLoad"><span class="hs-identifier hs-var">CmmLoad</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051986"><span class="hs-identifier hs-var">ldv_wd</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmType
</span><a href="GHC.Cmm.Type.html#bWord"><span class="hs-identifier hs-var">bWord</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051987"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-355"></span><span>                                             </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; CmmLit
</span><a href="GHC.Cmm.Utils.html#mkWordCLit"><span class="hs-identifier hs-var">mkWordCLit</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051987"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Integer
</span><a href="GHC.Driver.Session.html#iLDV_CREATE_MASK"><span class="hs-identifier hs-var">iLDV_CREATE_MASK</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051988"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-356"></span><span>                        </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; CmmExpr -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#cmmOrWord"><span class="hs-identifier hs-var">cmmOrWord</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051987"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; CmmExpr
</span><a href="GHC.StgToCmm.Prof.html#loadEra"><span class="hs-identifier hs-var">loadEra</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051988"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Integer -&gt; CmmLit
</span><a href="GHC.Cmm.Utils.html#mkWordCLit"><span class="hs-identifier hs-var">mkWordCLit</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051987"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Integer
</span><a href="GHC.Driver.Session.html#iLDV_STATE_USE"><span class="hs-identifier hs-var">iLDV_STATE_USE</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051988"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-357"></span><span>    </span><span class="annot"><span class="annottext">FCode () -&gt; FCode ()
</span><a href="GHC.StgToCmm.Prof.html#ifProfiling"><span class="hs-identifier hs-var">ifProfiling</span></a></span><span> </span><span class="annot"><span class="annottext">(FCode () -&gt; FCode ()) -&gt; FCode () -&gt; FCode ()
forall a b. (a -&gt; b) -&gt; a -&gt; b
</span><a href="../../base/src/GHC.Base.html#%24"><span class="hs-operator hs-var">$</span></a></span><span>
</span><span id="line-358"></span><span>         </span><span class="hs-comment">-- if (era &gt; 0) {</span><span>
</span><span id="line-359"></span><span>         </span><span class="hs-comment">--    LDVW((c)) = (LDVW((c)) &amp; LDV_CREATE_MASK) |</span><span>
</span><span id="line-360"></span><span>         </span><span class="hs-comment">--                era | LDV_STATE_USE }</span><span>
</span><span id="line-361"></span><span>        </span><span class="annot"><span class="annottext">CmmAGraph -&gt; FCode ()
</span><a href="GHC.StgToCmm.Monad.html#emit"><span class="hs-identifier hs-var">emit</span></a></span><span> </span><span class="annot"><span class="annottext">(CmmAGraph -&gt; FCode ()) -&gt; FCode CmmAGraph -&gt; FCode ()
forall (m :: * -&gt; *) a b. Monad m =&gt; (a -&gt; m b) -&gt; m a -&gt; m b
</span><a href="../../base/src/GHC.Base.html#%3D%3C%3C"><span class="hs-operator hs-var">=&lt;&lt;</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmAGraph -&gt; CmmAGraph -&gt; FCode CmmAGraph
</span><a href="GHC.StgToCmm.Monad.html#mkCmmIfThenElse"><span class="hs-identifier hs-var">mkCmmIfThenElse</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">MachOp -&gt; [CmmExpr] -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmMachOp"><span class="hs-identifier hs-var">CmmMachOp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; MachOp
</span><a href="GHC.Cmm.MachOp.html#mo_wordUGt"><span class="hs-identifier hs-var">mo_wordUGt</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051987"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">[</span><span class="annot"><span class="annottext">DynFlags -&gt; CmmExpr
</span><a href="GHC.StgToCmm.Prof.html#loadEra"><span class="hs-identifier hs-var">loadEra</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051988"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">,</span><span> </span><span class="annot"><span class="annottext">CmmLit -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLit"><span class="hs-identifier hs-var">CmmLit</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; CmmLit
</span><a href="GHC.Cmm.Utils.html#zeroCLit"><span class="hs-identifier hs-var">zeroCLit</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051987"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span class="hs-special">)</span><span>
</span><span id="line-362"></span><span>                     </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmExpr -&gt; CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkStore"><span class="hs-identifier hs-var">mkStore</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051986"><span class="hs-identifier hs-var">ldv_wd</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051985"><span class="hs-identifier hs-var">new_ldv_wd</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-363"></span><span>                     </span><span class="annot"><span class="annottext">CmmAGraph
</span><a href="GHC.Cmm.Graph.html#mkNop"><span class="hs-identifier hs-var">mkNop</span></a></span><span>
</span><span id="line-364"></span><span>
</span><span id="line-365"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#loadEra"><span class="hs-identifier hs-type">loadEra</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>
</span><span id="line-366"></span><span id="loadEra"><span class="annot"><span class="annottext">loadEra :: DynFlags -&gt; CmmExpr
</span><a href="GHC.StgToCmm.Prof.html#loadEra"><span class="hs-identifier hs-var hs-var">loadEra</span></a></span></span><span> </span><span id="local-6989586621681051976"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051976"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">MachOp -&gt; [CmmExpr] -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmMachOp"><span class="hs-identifier hs-var">CmmMachOp</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Width -&gt; Width -&gt; MachOp
</span><a href="GHC.Cmm.MachOp.html#MO_UU_Conv"><span class="hs-identifier hs-var">MO_UU_Conv</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Width
</span><a href="GHC.Cmm.Type.html#cIntWidth"><span class="hs-identifier hs-var">cIntWidth</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051976"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">Platform -&gt; Width
</span><a href="GHC.Cmm.Type.html#wordWidth"><span class="hs-identifier hs-var">wordWidth</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051974"><span class="hs-identifier hs-var">platform</span></a></span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-367"></span><span>    </span><span class="hs-special">[</span><span class="annot"><span class="annottext">CmmExpr -&gt; CmmType -&gt; CmmExpr
</span><a href="GHC.Cmm.Expr.html#CmmLoad"><span class="hs-identifier hs-var">CmmLoad</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">CLabel -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#mkLblExpr"><span class="hs-identifier hs-var">mkLblExpr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">FastString -&gt; CLabel
</span><a href="GHC.Cmm.CLabel.html#mkRtsCmmDataLabel"><span class="hs-identifier hs-var">mkRtsCmmDataLabel</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">String -&gt; FastString
</span><a href="GHC.Data.FastString.html#fsLit"><span class="hs-identifier hs-var">fsLit</span></a></span><span> </span><span class="annot"><span class="annottext">String
</span><span class="hs-string">&quot;era&quot;</span></span><span class="hs-special">)</span><span class="hs-special">)</span><span class="hs-special">)</span><span>
</span><span id="line-368"></span><span>             </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; CmmType
</span><a href="GHC.Cmm.Type.html#cInt"><span class="hs-identifier hs-var">cInt</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051976"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span class="hs-special">]</span><span>
</span><span id="line-369"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681051974"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681051974"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051976"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-370"></span><span>
</span><span id="line-371"></span><span class="annot"><a href="GHC.StgToCmm.Prof.html#ldvWord"><span class="hs-identifier hs-type">ldvWord</span></a></span><span> </span><span class="hs-glyph">::</span><span> </span><span class="annot"><a href="GHC.Driver.Session.html#DynFlags"><span class="hs-identifier hs-type">DynFlags</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span> </span><span class="hs-glyph">-&gt;</span><span> </span><span class="annot"><a href="GHC.Cmm.Expr.html#CmmExpr"><span class="hs-identifier hs-type">CmmExpr</span></a></span><span>
</span><span id="line-372"></span><span class="hs-comment">-- Takes the address of a closure, and returns</span><span>
</span><span id="line-373"></span><span class="hs-comment">-- the address of the LDV word in the closure</span><span>
</span><span id="line-374"></span><span id="ldvWord"><span class="annot"><span class="annottext">ldvWord :: DynFlags -&gt; CmmExpr -&gt; CmmExpr
</span><a href="GHC.StgToCmm.Prof.html#ldvWord"><span class="hs-identifier hs-var hs-var">ldvWord</span></a></span></span><span> </span><span id="local-6989586621681051970"><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051970"><span class="hs-identifier hs-var">dflags</span></a></span></span><span> </span><span id="local-6989586621681051969"><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051969"><span class="hs-identifier hs-var">closure_ptr</span></a></span></span><span>
</span><span id="line-375"></span><span>    </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">Platform -&gt; CmmExpr -&gt; Int -&gt; CmmExpr
</span><a href="GHC.Cmm.Utils.html#cmmOffsetB"><span class="hs-identifier hs-var">cmmOffsetB</span></a></span><span> </span><span class="annot"><span class="annottext">Platform
</span><a href="#local-6989586621681051968"><span class="hs-identifier hs-var">platform</span></a></span><span> </span><span class="annot"><span class="annottext">CmmExpr
</span><a href="#local-6989586621681051969"><span class="hs-identifier hs-var">closure_ptr</span></a></span><span> </span><span class="hs-special">(</span><span class="annot"><span class="annottext">DynFlags -&gt; Int
</span><a href="GHC.Driver.Session.html#oFFSET_StgHeader_ldvw"><span class="hs-identifier hs-var">oFFSET_StgHeader_ldvw</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051970"><span class="hs-identifier hs-var">dflags</span></a></span><span class="hs-special">)</span><span>
</span><span id="line-376"></span><span>    </span><span class="hs-keyword">where</span><span> </span><span id="local-6989586621681051968"><span class="annot"><span class="annottext">platform :: Platform
</span><a href="#local-6989586621681051968"><span class="hs-identifier hs-var hs-var">platform</span></a></span></span><span> </span><span class="hs-glyph">=</span><span> </span><span class="annot"><span class="annottext">DynFlags -&gt; Platform
</span><a href="GHC.Driver.Session.html#targetPlatform"><span class="hs-identifier hs-var hs-var">targetPlatform</span></a></span><span> </span><span class="annot"><span class="annottext">DynFlags
</span><a href="#local-6989586621681051970"><span class="hs-identifier hs-var">dflags</span></a></span><span>
</span><span id="line-377"></span></pre></body></html>